<?php
get_header();
print "<div class=\"subpage_content\">";
print "<div id=\"accordion\">";

if ($posts->total > 0) {
	foreach($posts->items as $post) {
?>			
			
            <h3 style="background-color:#FFF;"><?php $post->the_permalink(); ?></h3>
		
			<div style=" font-size:13px;"><?php $post->the_content(); ?>
            <?php 
			$catergory = $post->get_post_cat();
			$post_id = $post->get_id(); 
			if($catergory == 2)
			{
			 print "<div class=\"comment_button\"><a class=\"comment_link\" href=\"/add_comment.php?postid=$post_id\">Add Comment</a></div>";
			}
			?>
           
            
            <div>
            
            
            
            <?php
          
				$comments = get_comments(array(
				'where' => '`comment_post_id` = "'.$post->get_id().'"'));
				?>
						
					
				<?php foreach($comments->items as $comment) { ?>
							<?php // $comment->css(); ?>
								<div class="comment_item">
                                <div class="commentmeta">
									<?php //$comment->the_permalink(true, array('text'=>$comment->get_gravatar(true, array('size'=>48)))); ?>
									<span><b><?php //strtoupper($comment->the_author_link()); ?></b></span>
									<span><?php $comment->the_date('F jS, g:ia'); ?></span>
								</div>
								
								<div class="commentcontent">
									<?php $comment->the_content(); ?>
								</div>
							
							</div>
				<?php } 
				
			?>
					
            
            
            
            </div>
       
            </div>
<?php } ?>            
            
			
<?php } ?>


<?php
print "</div>";
print "</div>";
get_footer();
?>